package dataStructures;

import java.net.NetworkInterface;
import java.net.InetAddress;
import java.util.HashMap;
import java.util.Map;

/**
 * Diese Klasse repräsentiert die Routing-Tabelle auf der der Router arbeitet. Singleton.
 * @author pascal
 *
 */
public class RoutingTable {
	
	private static RoutingTable instance=null;
	private Map<InetAddress, NetworkInterface> table;
	
	private RoutingTable(){
		this.table = new HashMap<InetAddress, NetworkInterface>();
	}
	
	public static RoutingTable getInstance(){
		if(instance == null){
			instance = new RoutingTable();
		}
		return instance;
	}
	
	/**
	 * Fügt eine Route hinzu.
	 * @param target
	 * @param outInterface
	 */
	public void addRoute(InetAddress target, NetworkInterface outInterface){
		table.put(target, outInterface);
	}
	
	
	

}
